home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.events.Event;
- import flash.events.TimerEvent;
- import flash.media.Sound;
- import flash.media.SoundChannel;
- import flash.media.SoundTransform;
- import flash.utils.Timer;
-
- public class BaseSound extends Sound
- {
-
-
- private var §\x01\x01\x01\b§:SoundTransform;
-
- private var §\x01\x01\x01\t§:Boolean;
-
- private var §\x01\x01\x01\n§:Boolean;
-
- private var §\x01\x01\x01\x0b§:Number;
-
- private var §\x01\x01\x01\f§:Boolean;
-
- private var §\x01\x01\x01\x10§:Sound;
-
- private var §\x01\x01\x02\x02§:SoundChannel;
-
- private var §\x01\x01\x02\x04§:Timer;
-
- private var §\x01\x01\x02\x06§:Number;
-
- private var §\x01\x01\x02\b§:Number;
-
- public function BaseSound()
- {
- super();
- §\x01\x01\x01\x10§ = this;
- §\x01\x01\x02\x02§ = null;
- §\x01\x01\x01\b§ = null;
- §\x01\x01\x02\x06§ = 1;
- §\x01\x01\x02\b§ = 0;
- §\x01\x01\x01\x0b§ = 0;
- §\x01\x01\x01\n§ = false;
- §\x01\x01\x01\t§ = false;
- §\x01\x01\x01\f§ = false;
- §\x01\x01\x02\x04§ = new Timer(50);
- §\x01\x01\x02\x04§.addEventListener(TimerEvent.TIMER,§\x01\x01\x02\x01§);
- §\x01\x01\x02\x04§.start();
- }
-
- public function setVolume(param1:Number) : void
- {
- var _loc2_:SoundTransform = null;
- §\x01\x01\x02\x06§ = param1;
- _loc2_ = §\x01\x01\x02\x02§.soundTransform;
- _loc2_.volume = §\x01\x01\x02\x06§;
- §\x01\x01\x02\x02§.soundTransform = _loc2_;
- }
-
- public function stopSound() : void
- {
- if(§\x01\x01\x02\x02§)
- {
- §\x01\x01\x02\x02§.stop();
- §\x01\x01\x02\x02§.removeEventListener(Event.SOUND_COMPLETE,§\x01\x01\x02\x07§);
- §\x01\x01\x01\f§ = false;
- }
- }
-
- public function fadeOut(param1:Boolean) : void
- {
- §\x01\x01\x01\t§ = true;
- §\x01\x01\x01\n§ = false;
- if(param1)
- {
- setVolume(1);
- }
- }
-
- public function §\x01\x01\x01\r§() : void
- {
- if(§\x01\x01\x02\x02§)
- {
- §\x01\x01\x01\x0b§ = §\x01\x01\x02\x02§.position;
- §\x01\x01\x02\x02§.stop();
- §\x01\x01\x02\x02§.removeEventListener(Event.SOUND_COMPLETE,§\x01\x01\x02\x07§);
- }
- }
-
- public function §\x01\x01\x01\x0e§() : void
- {
- stopSound();
- §\x01\x01\x02\x02§ = §\x01\x01\x01\x10§.play();
- setVolume(§\x01\x01\x02\x06§);
- §\x01\x01\x02\x03§(§\x01\x01\x02\b§);
- }
-
- public function §\x01\x01\x01\x0f§(param1:Boolean) : void
- {
- §\x01\x01\x01\n§ = true;
- §\x01\x01\x01\t§ = false;
- if(param1)
- {
- setVolume(0);
- }
- }
-
- private function §\x01\x01\x02\x01§(param1:TimerEvent) : void
- {
- if(§\x01\x01\x01\n§ && §\x01\x01\x01\t§)
- {
- §\x01\x01\x01\n§ = false;
- §\x01\x01\x01\t§ = false;
- setVolume(1);
- }
- if(§\x01\x01\x01\n§)
- {
- §\x01\x01\x02\x06§ += 0.01;
- if(§\x01\x01\x02\x06§ > 1)
- {
- setVolume(1);
- §\x01\x01\x01\n§ = false;
- }
- else
- {
- setVolume(§\x01\x01\x02\x06§);
- }
- }
- if(§\x01\x01\x01\t§)
- {
- §\x01\x01\x02\x06§ -= 0.01;
- if(§\x01\x01\x02\x06§ < 0)
- {
- setVolume(0);
- §\x01\x01\x01\t§ = false;
- }
- else
- {
- setVolume(§\x01\x01\x02\x06§);
- }
- }
- }
-
- public function §\x01\x01\x02\x03§(param1:Number) : void
- {
- var _loc2_:SoundTransform = null;
- §\x01\x01\x02\b§ = param1;
- if(§\x01\x01\x02\x02§)
- {
- _loc2_ = §\x01\x01\x02\x02§.soundTransform;
- _loc2_.pan = §\x01\x01\x02\b§;
- §\x01\x01\x02\x02§.soundTransform = _loc2_;
- }
- }
-
- public function §\x01\x01\x02\x05§() : void
- {
- stopSound();
- §\x01\x01\x02\x02§ = §\x01\x01\x01\x10§.play(§\x01\x01\x01\x0b§);
- if(§\x01\x01\x01\f§)
- {
- §\x01\x01\x02\x02§.addEventListener(Event.SOUND_COMPLETE,§\x01\x01\x02\x07§);
- }
- setVolume(§\x01\x01\x02\x06§);
- §\x01\x01\x02\x03§(§\x01\x01\x02\b§);
- }
-
- private function §\x01\x01\x02\x07§(param1:Event) : *
- {
- §\x01\x01\x02\x02§ = §\x01\x01\x01\x10§.play();
- setVolume(§\x01\x01\x02\x06§);
- §\x01\x01\x02\x03§(§\x01\x01\x02\b§);
- §\x01\x01\x02\x02§.addEventListener(Event.SOUND_COMPLETE,§\x01\x01\x02\x07§);
- }
-
- public function playSoundLoop() : void
- {
- stopSound();
- §\x01\x01\x02\x02§ = §\x01\x01\x01\x10§.play();
- §\x01\x01\x02\x02§.addEventListener(Event.SOUND_COMPLETE,§\x01\x01\x02\x07§);
- setVolume(§\x01\x01\x02\x06§);
- §\x01\x01\x02\x03§(§\x01\x01\x02\b§);
- §\x01\x01\x01\f§ = true;
- }
- }
- }
-